package com.ruoyi.bl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bl.mapper.BlSuppliersMapper;
import com.ruoyi.bl.domain.BlSuppliers;
import com.ruoyi.bl.service.IBlSuppliersService;

/**
 * 供应商Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-20
 */
@Service
public class BlSuppliersServiceImpl implements IBlSuppliersService 
{
    @Autowired
    private BlSuppliersMapper blSuppliersMapper;

    /**
     * 查询供应商
     * 
     * @param supplierId 供应商主键
     * @return 供应商
     */
    @Override
    public BlSuppliers selectBlSuppliersBySupplierId(Long supplierId)
    {
        return blSuppliersMapper.selectBlSuppliersBySupplierId(supplierId);
    }

    /**
     * 查询供应商列表
     * 
     * @param blSuppliers 供应商
     * @return 供应商
     */
    @Override
    public List<BlSuppliers> selectBlSuppliersList(BlSuppliers blSuppliers)
    {
        return blSuppliersMapper.selectBlSuppliersList(blSuppliers);
    }

    /**
     * 新增供应商
     * 
     * @param blSuppliers 供应商
     * @return 结果
     */
    @Override
    public int insertBlSuppliers(BlSuppliers blSuppliers)
    {
        blSuppliers.setCreateTime(DateUtils.getNowDate());
        return blSuppliersMapper.insertBlSuppliers(blSuppliers);
    }

    /**
     * 修改供应商
     * 
     * @param blSuppliers 供应商
     * @return 结果
     */
    @Override
    public int updateBlSuppliers(BlSuppliers blSuppliers)
    {
        blSuppliers.setUpdateTime(DateUtils.getNowDate());
        return blSuppliersMapper.updateBlSuppliers(blSuppliers);
    }

    /**
     * 批量删除供应商
     * 
     * @param supplierIds 需要删除的供应商主键
     * @return 结果
     */
    @Override
    public int deleteBlSuppliersBySupplierIds(Long[] supplierIds)
    {
        return blSuppliersMapper.deleteBlSuppliersBySupplierIds(supplierIds);
    }

    /**
     * 删除供应商信息
     * 
     * @param supplierId 供应商主键
     * @return 结果
     */
    @Override
    public int deleteBlSuppliersBySupplierId(Long supplierId)
    {
        return blSuppliersMapper.deleteBlSuppliersBySupplierId(supplierId);
    }
}
